<template>
	<view class="order">
		<view class="tab flex tc tb p-tb-25 bc-w">
			<view v-for="(item,index) in orderStatus" :class="'col-'+orderStatus.length" @tap="setTab(index)">
				<view :class="orderStatusIndex == index ? 'selectColor' : ''">
					{{item.name}}
					<view class="line" :class="orderStatusIndex == index ? 'backColor' : ''"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderStatus: [{
						value: "all",
						name: "全部"
					},
					{
						value: "0",
						name: "待付定金"
					},
					// {
					// 	value: "1",
					// 	name: "待全付"
					// },
					{
						value: "2",
						name: "已付定金"
					},
					{
						value: "3",
						name: "已取消"
					}
				],
				css: {},
				orderStatusIndex: 0,
				orderList: [],
				currentPage: 1,
			}
		},
		onLoad() {

		},
		methods: {
			setTab(index) {
				this.orderStatusIndex = index;
				this.currentPage = 1;
				this.orderList = [];
				this.$emit('setTab', this.orderStatusIndex - 1)
			},
		}
	}
</script>

<style lang="less" scoped>
	.selectColor {
		color: #65c61d
	}

	.line {
		height: 4rpx;
		width: 60rpx;
		margin: 10rpx auto 0;
	}

	.backColor {
		background-color: #65c61d;
	}
</style>